{% load static %}
{% include 'huiyiyuding/core/base.html' %}
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
  <legend>修改会议室</legend>
</fieldset>
    <form class="layui-form" action="/bookmeeting/" method="post">
            {% csrf_token %}

      <div class="layui-form-item">
        <label class="layui-form-label">选择会议室：</label>
        <div class="layui-input-block">
            {% for meeting in name %}

                 <select name="meeting" lay-verify="required">
                     <option value="{{ meeting }}">{{ meeting }} </option>
                    {% empty %}
              </select>
            {% endfor %}
        </div>
      </div>
    <div class="layui-form-item">
    <div class="layui-inline">
      <label class="layui-form-label">开始时间</label>
      <div class="layui-input-inline">
        <input type="text" class="layui-input" id="stime" name="stime" placeholder="yyyy-MM-dd HH:mm:ss">
      </div>
    </div>
        <div class="layui-inline">
      <label class="layui-form-label">结束时间</label>
      <div class="layui-input-inline">
        <input type="text" class="layui-input" id="etime" name="etime" placeholder="yyyy-MM-dd HH:mm:ss">
      </div>
    </div>
       <div class="layui-form-item">
    <label class="layui-form-label">预约人：</label>
    <div class="layui-input-inline">
      <select name="applyname">
             <option value="{{ user.username }}">{{ user.username }}</option>
      </select>
    </div>
   </div>
    <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit="" lay-filter="formDemo">修改</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
  </div>
    </div>
</form>

<script>
    //Demo
layui.use(['form','laydate'] ,function(){
      var form = layui.form
      ,laydate = layui.laydate;

          //日期时间范围
      laydate.render({
        elem: '#stime'
        ,type: 'datetime'
      });
      laydate.render({
        elem: '#etime'
        ,type: 'datetime'
      });
      form.on('select()', function(data){
          console.log(data.elem); //得到select原始DOM对象
          console.log(data.value); //得到被选中的值
          console.log(data.othis); //得到美化后的DOM对象
        });

      //监听提交

        form.on('submit(formDemo)' , function(data){
              console.log(data.field) //当前容器的全部表单字段，名值对形式：{name: value}
              {#return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。#}
            });
});
</script>
{% include 'huiyiyuding/core/foot.html' %}




